package com.hx.nacosdemo.controller;

/**
 * @author chm
 * @title: ProductController
 * @projectName nacosdemo
 * @description: TODO
 * @date 2020/3/211:29
 */
import java.util.List;

import com.hx.nacosdemo.pojo.Product;
import com.hx.nacosdemo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
public class ProductController {

    @Autowired
    ProductService productService;

    @RequestMapping("/products")
    public Object products() {
        List<Product> ps = productService.listProducts();
        return ps;
    }
}